package com.nit.netty.handler;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandler;
import io.netty.channel.ChannelInboundHandlerAdapter;
import lombok.extern.slf4j.Slf4j;

import java.util.logging.Logger;

/**
 * @Author: whb
 * @Description:
 * @CreateTime: 2020/8/21 13:33
 */
@Slf4j
public abstract class AbstractNettyHandler extends ChannelInboundHandlerAdapter {

    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        log.info("与{}的连接已建立", ctx.channel().remoteAddress());
    }

    @Override
    public void channelInactive(ChannelHandlerContext ctx) {
        log.info("与{}的连接已关闭", ctx.channel().remoteAddress());
    }
}
